<form action="" class="form-horizontal" role="form">
  <div class="form-group">
      <label class="col-sm-2 control-label">客户姓名</label>
      <div class="col-sm-2">
        <input type="text" class="form-control" name="name" placeholder="" datatype="*2-20" value="{$customer.name}">
      </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">所属合作商</label>
    <div class="col-sm-2">
      <select class="form-control" name="partner">{$customer.partnerOptions}</select>
    </div>
  </div>
  <div class="form-group">
      <label class="col-sm-2 control-label">客户邮箱</label>
      <div class="col-sm-3">
        <input type="email" class="form-control" name="email" placeholder="作为客户登陆后台账户"  datatype="e" value="{$customer.email}">
      </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">客户联系人</label>
    <div class="col-sm-2">
      <input type="text" class="form-control" name="contacts" placeholder="客户联系人" datatype="*" value="{$customer.contacts}"/>
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">联系人电话</label>
    <div class="col-sm-2">
      <input type="text" class="form-control" name="tel" placeholder="输入手机或者电话号码" datatype="phone" value="{$customer.tel}"/>
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">客户地区</label>
    <div class="row">
      <div class="col-sm-2">
        <select class="form-control" id="province" name="province" datatype="*">{$customer.provinceOptions}</select>
      </div>
      <div class="col-sm-2">
        <select class="form-control" id="city" name="city" datatype="*">{$customer.cityOptions}</select>
      </div>
      <div class="col-sm-2">
        <select class="form-control" id="area" name="area" datatype="*">{$customer.areaOptions}</select>
      </div>    
    </div>
  </div>
  
  <div class="form-group">
    <label class="col-sm-2 control-label">客户具体地址</label>
    <div class="col-sm-3">
      <input type="text" class="form-control" name="address" placeholder="客户的具体地址" datatype="*" value="{$customer.address}" />
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">客户服务开始时间</label>
    <div class="col-sm-2">
      <input type="text" id="begin-time" class="form-control" name="begin_time" placeholder="选择客户服务开始的时间" datatype="*" value="{$customer['begin_time'] ? date('Y-m-d H:i', $customer['begin_time']) : ''}">
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">客户服务结束时间</label>
    <div class="col-sm-2">
      <input type="text" id="end-time" class="form-control" name="end_time" placeholder="选择客户服务结束的时间" datatype="*" value="{$customer['end_time'] ? date('Y-m-d H:i', $customer['end_time']) : ''}">
    </div>
  </div>
  
  <div class="form-group">
    <label class="col-sm-2 control-label">技术支持信息</label>
    <div class="col-sm-5">
      <textarea type="text" class="form-control" name="support" placeholder="技术支持信息" rows="3">{$customer['support']}</textarea>
    </div>
  </div>
  
  <div class="form-group">
    <label class="col-sm-2 control-label">技术支持显示类型</label>
    <div class="col-sm-3">
      <select class="form-control" id="support_type" name="support_type">{$customer.supportTypeOptions}</select>
    </div>
  </div>
  
  <div class="form-group">
    <label class="col-sm-2 control-label">个性三级域名</label>
    <div class="col-sm-3">
      <input type="text" class="form-control" name="domain" placeholder="个性三级域名" value="{$customer.domain}" />
      <span class="label label-danger">注意：修改此三级域名后，所有公众平台自定义菜单、接口都要重新设置。</span>
    </div>
  </div>
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-8">
      <input type="hidden" name="id" value="{$customer.id}"/>
      <button type="submit" class="btn btn-primary submit" data-loading-txt="提交中，请稍后……" data-ajax-url="__CONTROLLER__/modifyPost">保存更改</button>
    </div>
  </div>
</form>

<!-- datetimepicker -->
<link rel="stylesheet" href="__PUBLIC__/Style/Common/datetimepicker/bootstrap-datetimepicker.min.css">
<script src="__PUBLIC__/Style/Common/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="__PUBLIC__/Style/Common/datetimepicker/bootstrap-datetimepicker.zh-CN.js"></script>
<script type="text/javascript">
  $(function(){
    $("#province").change(function(){
      var pro = $(this).val()
      $.post("__CONTROLLER__/getCityPost", {code: pro} ,function(data){
        $("#city").html(data);
      });
    });
    
    $("#city").change(function(){
      var cit = $(this).val()
      $.post("__CONTROLLER__/getAreaPost", {code: cit} ,function(data){
        $("#area").html(data);
      });
    });
    
    $("#begin-time").datetimepicker({
      "language": "zh-CN"
    });
    
    $("#end-time").datetimepicker({
      "language": "zh-CN"
    });
  });
</script>